package cn.kgm.template.api;

import cn.kgm.core.http.response.R;
import cn.kgm.template.api.factory.TemplateInfoFallbackFactory;
import cn.kgm.template.dto.dto.TemplateInfoSaveDTO;
import cn.kgm.template.dto.dto.TemplateInfoUpdateDTO;
import cn.kgm.template.dto.query.TemplateInfoPageQuery;
import cn.kgm.template.dto.vo.TemplateInfoVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * # 技术改变自己 #
 * 模板信息收集表
 *
 * @author kapp-i
 * @email yolo.jk@qq.com
 * @date 2024-03-18 15:36:57
 */
@FeignClient(contextId = "templateInfoFeignApi",
        name = "${spring.application.name}",
        fallbackFactory = TemplateInfoFallbackFactory.class)
public interface TemplateInfoFeignApi {

    /**
     * 分页列表查询模板信息收集表
     */
    @ApiOperation(value = "分页查询", notes = "分页查询模板信息收集表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNo", value = "页码", dataType = "long", paramType = "query", defaultValue = "1"),
            @ApiImplicitParam(name = "pageSize", value = "分页条数", dataType = "long", paramType = "query", defaultValue = "10"),
    })
    @GetMapping(value = "/templateInfo/page")
    R<IPage<TemplateInfoVO>> page(TemplateInfoPageQuery data);

    /**
     * 根据id查询模板信息收集表详情
     */
    @ApiOperation(value = "查看详情", notes = "根据id查询模板信息收集表详情")
    @GetMapping(value = "/templateInfo/{id}")
    R<TemplateInfoVO> get(@PathVariable(value = "id") Long id);

    /**
     * 新增模板信息收集表
     */
    @ApiOperation(value = "新增", notes = "新增模板信息收集表")
    @PostMapping("/templateInfo/save")
    R<Boolean> save(@RequestBody @Validated TemplateInfoSaveDTO data);

    /**
     * 修改模板信息收集表
     */
    @ApiOperation(value = "修改", notes = "修改模板信息收集表")
    @PostMapping("/templateInfo/update")
    R<Boolean> update(@RequestBody @Validated TemplateInfoUpdateDTO data);

    /**
     * 根据id更新模板信息收集表的删除状态
     */
    @ApiOperation(value = "删除", notes = "根据id更新模板信息收集表的删除状态")
    @GetMapping(value = "/templateInfo/delete/{ids}")
    R<Boolean> delete(@PathVariable(value = "ids") Long[] ids);
}

